<template>
<scroll-view scroll-y :class="pageClass" :style="pageStyle" v-if="pageReady">
		<moxi-nav :set="navSet"></moxi-nav>
		<view style="width: 100%;height: 200px;background-color:rgb(254,83,65);position: relative;overflow-x: hidden">
			<img src="https://moxifile.oss-cn-beijing.aliyuncs.com/images/mp/images/quan.png" 
			style="position: absolute;;left: 60px;bottom:-60px ;width: 120px;height: 120px;" alt="">
			<img src="https://moxifile.oss-cn-beijing.aliyuncs.com/images/mp/images/quan.png"
			style="position: absolute;;right: -60px;top:10px ;width: 160px;height: 160px;" alt="">
			
			<view class="userinfo" v-if="userinfo.id">
				<view style="display: flex;flex-direction: row;justify-content: space-between;">
					<view style="display: flex;flex-direction: row;">
						<img class="user_pic" :src="userinfo.pic" alt="">
						<view style="margin: 10px 5px;">
							<view style="margin-left: 10px;color: #fff;">
								<text v-if="userinfo.showname">{{userinfo.showname}}</text>
								<text v-else>{{userinfo.username}}</text>
							</view>
							<view style="padding: 3px 8px;background-color: #fff;color: #666;font-size: 12px;border-radius: 25px;">普通用户</view>
						</view>
					</view>
					<!-- <view style="margin-top: 20px;;" @click="loginOut()">
						<u-icon name="person-delete-fill" size="24" color="#fff"></u-icon>
					</view> -->
				</view>
				<view class="text" style="" v-if="userinfo.numInfo">
					<view class="text-box">
						<view style="color: #fff;font-weight: 600">{{userinfo.numInfo.project}}</view>
						<view style="color: #fff;font-size: 14px;">收藏项目</view>
					</view>
					<view class="text-box">
						<view style="color: #fff;font-weight: 600">{{userinfo.numInfo.collect}}</view>
						<view style="color: #fff;font-size: 14px;">收藏产品</view>
					</view>
					
				</view>
			</view>
		</view>
		<view class="ruzhu" v-if="(!userinfo.qiye||!userinfo.qiye.id) && (userinfo.join_msg && userinfo.join_msg.length)">
			<view class="ruzhu-box">
				<view style="font-size: 13px;color: #fff;margin-left: 20px;display: flex;flex-direction: row;justify-content: space-between;">
					<text style="margin-top: 3px;">{{userinfo.join_msg}}</text>
					<view class="shenqing" @click="sq()">
						<text>申请入驻</text>
						 <u-icon name="play-right-fill" color="rgb(85,57,56)" size="16"></u-icon>
					</view>
				</view>
			</view>
		</view>
		<view >
		<view v-for="(list,key) in modData" :class="list.mod_class" :key="key" :style="list.css">
		    <moxi-index :list="list"></moxi-index>
		</view>
		</view>
		 <moxi-tabbar :set="tabbar" v-if="tabbar.index_id"></moxi-tabbar>
	</scroll-view>
</template>

<script>
	export default {
		data() {
			return {
				userinfo:{},
				gridSet:{
					col:4,
					border:0,
					size:50,
					showTitle:1,
					titleColor:"#909399",
					
				}
			}
		},
		created(){ 
			const param  =  this.requestParam({});
			
			this.get()
		},
		methods: {
			sq(){
				this.navto('plugin_info/apply')
			},
			get(){
				let self = this;
				this.moxiPost('/plugin/info/user/qiye/userinfo',{},function(data){
					self.userinfo = data.data;
				})
			},
			loginOut(){
				uni.clearStorage();
				this.msg('操作成功')
				this.moxiPost('/index/user/loginout',{},()=>{
					uni.redirectTo({
						url: '/pages/index/index'
					});
				})
			}
		}
	}
</script>

<style>
	.text{display: flex;flex-direction: row;justify-content: space-between;}
	.user_pic{width: 60px;height: 60px;border-radius: 100px;border: 3px #fff solid}
	.userinfo{margin: 25px 30px;display: flex;flex-direction: column;justify-content: space-between;height:130px;}
	.text-box{display: flex;flex-direction: column;text-align: center;}

	.ruzhu{width: 100%;height: 50px;justify-content: center;display: flex;margin-top: -30px;z-index: 99910;}
	.ruzhu-box{width: 90%;height: 100%;background-color: rgba(85,57,56,1);border-radius: 25px;z-index: 99910;display: flex;justify-items: center;justify-content: center;flex-direction: column;color: #fff;}
	.shenqing{
	display: flex;flex-direction: row;background:linear-gradient(to right,rgb(254,231,205),rgb(254, 234, 192)) ;border-radius: 25px;color: rgb(85,57,56);
	padding: 5px 12px;font-size: 12px;margin-right: 10px;
}
</style>
